<% unless @backups.empty? %>

  <ul>
    <% for backup in @backups %>
      <li>
        <%= backup.name.sub(/Backup$/,'') %> <%= backup.username if backup.respond_to?:username %>
        <% form_tag "/backups/#{ backup.id }/run", :style => 'display: inline;' do %>
          <%= submit_tag 'Run' %>
        <% end %>
      </li>
    <% end %>
  </ul>

<% else %>

  <p>You have no backups</p>

<% end %>

<% form_tag backups_path, :method => :post do %>
  <%= select_tag 'backup_type', "<option>Select Type ...</option>" + 
    Backup.plugins.map {|p| "<option>#{p.to_s.sub(/Backup$/,'')}</option>" }.join('') %>
  <%= submit_tag 'Create Backup' %>
  <div id="selected_plugin_attributes"></div>
<% end %>
